import axios, { AxiosRequestConfig } from 'axios'

function get<T>(url: string, params?: object): Promise<T> {
    return axios.get<unknown, T>(url, { params })
}

function post<T>(
    url: string,
    data?: object,
    config?: AxiosRequestConfig
): Promise<T> {
    return axios.post<unknown, T>(url, data, config)
}

export default {
    get,
    post
}
